<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DOM1</title>
</head>
<body>
<img id = "light" src = "img/off.gif">
<h1 id = "title" >悔创阿里杰克马</h1>
<script>
       //通过id来获取对象
        /* var light = document.getElementById("light");
        alert(light);
        //[object HTMLImageElement]
        alert("我要换图了");
        light.src = ("img/on.gif");
        //将id的对象的图片换为on的图片*/
        var title = document.getElementById("title");
        alert("我要换了");
        title.innerHTML = "不识妻美刘强东";
        //修改内容
    </script>
</body>
</html>